<?php
namespace Admin\Controller;

use Think\Controller;

class BaseController extends Controller{
	const SUCCESS = 1;
	const ERROR = 0;
	public function return_app_data($code, $info,$attributes = []){
		echo json_encode(array_merge(['code' => $code, 'info' => $info], $attributes));
		exit();
	}
	public function returnSuccess($info,$attributes = []){
		$this->return_app_data(self::SUCCESS,$info, $attributes);
	}

	public function returnError($info = '',$attributes = []){
		$this->return_app_data(self::ERROR, $info,$attributes);
	}
}
?>
